Add codex backend to ccb#166
Conversation
Let CCB run its main conversation loop against codex app-server while keeping the existing Anthropic-compatible path working. Isolate the fork branding and config so it can coexist with the official Claude Code install.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (52)
📝 WalkthroughWalkthroughThis PR introduces Codex backend support for the CCB application alongside a comprehensive app identity abstraction system. The changes add OpenSpec workflow documentation for proposal/apply/archive/explore modes, implement a backend abstraction layer enabling switching between Anthropic and Codex for main conversation turns, replace hardcoded application naming with reusable constants, integrate local Codex app-server streaming via JSON-RPC, and extend model selection logic to support Codex-specific models. Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Main Loop
participant Backend as Backend Layer
participant CodexBackend as Codex Backend
participant AuthFile as Auth File (~/.codex/auth.json)
participant AppServer as Codex App-Server (stdio)
participant EventStream as Event Notifications
Client->>Backend: queryModelWithStreaming(args)
Backend->>CodexBackend: streamTurn(args)
CodexBackend->>AuthFile: Read local Codex auth
alt Auth Missing
CodexBackend-->>Backend: SystemAPIErrorMessage (auth error)
Backend-->>Client: Error event
else Auth Found
CodexBackend->>AppServer: Spawn/connect stdio JSON-RPC
AppServer-->>CodexBackend: Connection established
CodexBackend->>AppServer: RPC thread/start
AppServer-->>CodexBackend: Thread ID
CodexBackend->>AppServer: RPC turn/start
AppServer-->>CodexBackend: Turn started
AppServer->>EventStream: Emit stream notifications
EventStream->>CodexBackend: Receive events (filtered by thread)
CodexBackend->>CodexBackend: Convert to StreamEvent/content blocks
CodexBackend-->>Backend: Yield StreamEvent/delta events
Backend-->>Client: Yield streaming output
alt Abort Signal Received
Client->>Backend: Abort
Backend->>CodexBackend: Abort detected
CodexBackend->>AppServer: RPC turn/interrupt
AppServer-->>CodexBackend: Turn interrupted
end
CodexBackend->>CodexBackend: Finalize and cleanup
CodexBackend-->>Backend: Yield final AssistantMessage
Backend-->>Client: Complete
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
Comment |
Summary by CodeRabbit
New Features
CLAUDE_CODE_USE_CODEXenvironment variableDocumentation
Chores
ccbnpm script for development convenience